package com.example.commons.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_user_video_history")
@Schema(title = "用户视频历史记录对象", description = "用户视频历史记录")
public class UserVideoHistory implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(title = "序列号")
    @TableId(value = "id", type = IdType.AUTO)
    @ExcelProperty("序列号")
    private Long id;

    @Schema(title = "用户ID")
    @TableField("user_id")
    @ExcelProperty("用户ID")
    private Long userId;

    @Schema(title = "视频ID")
    @TableField("video_id")
    @ExcelProperty("视频ID")
    private Long videoId;

    @Schema(title = "浏览时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("浏览时间")
    private LocalDateTime createTime;
}
